﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Page/Site.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="chi-tiet-lenh-dieu-dong.aspx.cs" Inherits="VanTaiTMS.Page.chi_tiet_lenh_dieu_dong" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <!---Check-all----->
<script type="text/javascript">
    function checkAll(checkId) {
        $('.bordered tbody input').each(function () {
            if ($('input#chkAll').is(":checked")) {
                $(this).attr({ 'checked': 'checked' });
                $(this).parent().parent().css({ 'background': 'rgb(208, 233, 198)' });
            } else {
                $(this).attr({ 'checked': false });
                $(this).parent().parent().css({ 'background': '#ffffff' });
            }
        })
    }
</script>
<!-------End------->

<!------Popup------>
<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#thongbao').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "372px",
            position: ['center', 50],
            resizable: false,

            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function (type, data) {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>
<!-------End------->

<script type="text/javascript">
    function pageLoad(sender, args) {
        //FixTable
        $(document).ready(function () {
            var table = $('#testTable1').DataTable({
                "scrollX": "100%",
                scrollCollapse: true,
                paging: false,
                searching: false,
                "sDom": '<"top">rt<"bottom"flp><"clear">'

            });
            new $.fn.dataTable.FixedColumns(table, {
                //"leftColumns": 4
            });
        });

        $(function () {
            $(".textboxngaynhap").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                buttonImageOnly: true
            }).val();
        });


        $(function () {
            $(".textboxfillter").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                buttonImageOnly: true
            }).val();
        });

        $(function ($) {
            $(".textboxngaynhap").mask("99/99/9999"); //Kiem tra ngay nhap
            $(".textboxfillter").mask("99/99/9999"); //Kiem tra ngay nhap
            $("#phone").mask("(999) 999-9999");//Kiem tra so dien thoai
            $("#tin").mask("99-9999999");
            $("#ssn").mask("999-99-9999");
        });
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="upDatePanelAll" runat="server">
    <ContentTemplate>
    <div id="toolbar-1" class="yui3-toolbar">
        <asp:Panel id="panel1" runat="server" DefaultButton="cmdSerach">
            <div class="div-search_A">
                <asp:Button ID="cmdAddNew" runat="server" CssClass="btn-add-new"  Text="" onclick="cmdAddNew_Click" />
            </div>
        </asp:Panel>
        <div class="clr"></div>
    </div>
    <%=StrAlert%>

    <!-------------Edit-Dữ-Liệu-------------->
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title">Thông tin lệnh điều động</h3>
        </div>

        <div class="panel-body">
            <div class="ui-box-text-box">
                <label class="label">Chọn mã điều động <span style="color:Red">(*)</span></label>
                <asp:DropDownList ID="drMaDieuDong" CssClass="select-drop-child-a" runat="server" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="drMaDieuDong_SelectedIndexChanged">
                    <asp:ListItem Value="-1">--Chọn mã điều động--</asp:ListItem>
                </asp:DropDownList>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Ngày điều động <span style="color:Red">(*)</span></label>
                <asp:TextBox ID="txtNgayDieuDong" CssClass="textboxngaynhap" runat="server"></asp:TextBox>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Số xe <span style="color:Red">(*)</span></label>
                <asp:DropDownList ID="drSoXe" CssClass="select-drop-child-a" runat="server" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="drSoXe_SelectedIndexChanged">
                    <asp:ListItem Value="-1">--Chọn số xe--</asp:ListItem>
                </asp:DropDownList>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Nhóm xe <span style="color:Red">(*)</span></label>
                <asp:TextBox ID="txtNhomXe" CssClass="textbox" runat="server"></asp:TextBox>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Tài xế <span style="color:Red">(*)</span></label>
                <asp:TextBox ID="txtTaiXe" CssClass="textbox" runat="server"></asp:TextBox>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Loại xe <span style="color:Red">(*)</span></label>
                <asp:TextBox ID="txtLoaiXe" CssClass="textbox" runat="server"></asp:TextBox>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Chọn khoan <span style="color:Red">(*)</span></label>
                <asp:DropDownList ID="drChonKhoan" CssClass="select-drop-child-a" runat="server" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="drChonKhoan_SelectedIndexChanged">
                    <asp:ListItem Value="-1">--Chọn khoan chứa--</asp:ListItem>
                </asp:DropDownList>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Thể tích khoan chứa <span style="color:Red">(*)</span></label>
                <asp:TextBox ID="txtTheTich" CssClass="textbox" runat="server"></asp:TextBox>
            </div>

            <div class="clr"></div>
            <div class="ui-box-text-box">
                <label class="label">Nơi nhận hàng <span style="color:Red">(*)</span></label>
                <asp:TextBox ID="txtNoiNhanHang" CssClass="textbox" runat="server"></asp:TextBox>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Nơi trả hàng <span style="color:Red">(*)</span></label>
                <asp:TextBox ID="txtNoiTraHang" CssClass="textbox" runat="server"></asp:TextBox>
            </div>

            <div class="ui-box-text-box">
                <label class="label">Kiểm tra thể tích mặt hàng <span style="color:Red">(*)</span></label>
                <asp:Button ID="btnCheck"  CssClass="btn btn-primary btn-xs btn-check btn-block" runat="server" Text="Kiểm tra" OnClick="btnCheck_Click" />
            </div>
        </div>
    </div>
    <!--------------Kêt-thúc----------------->
    <div style="height:20px"></div>
    <div class="ui-main" style="display:none">
    <div style="height:20px"></div>
    <label class="label"><span style="color:Red;margin-left:8px;">Thông lệnh điều động</span></label>
    <div style="height:20px"></div>
    <!-----------Hiễn-Thị-Dữ-Liệu------------>
    <div class="table-responsive">
    <table class="bordered" id="testTable1">
        <thead>
            <tr>
                <th width="5%">STT</th>        
                <th width="5%">
                    #
                </th>
                <th width="10%">Mã điều động</th>
                <th width="10%">Ngày điều động</th>
                <th width="5%">Số xe</th>
                <th width="15%">Tài xế</th>
                <th width="15%">Nhóm xe</th>
                <th width="10%">Loại xe</th>
                <th width="15%">Chiều dài</th>
                <th width="10%">Chiều rộng</th>
                <th width="10%">Chiều cao</th>
            </tr>
        </thead>

        <tbody>
             <asp:ListView ID="ListViewAll" runat="server" ItemPlaceholderID="lstViewAll" DataKeyNames="DommandTransferOrder_ID" OnItemCommand="ListViewAll_ItemCommand" OnItemDataBound="ListViewAll_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td align="center" style="text-align:center">
                            <asp:Label ID="lb_lst_ID" runat="server" Text='<%# Eval("DommandTransferOrder_ID") %>'></asp:Label>
                        </td>

                        <td style="text-align:center">
                            <asp:CheckBox ID="chkList"  runat="server" />
                        </td>

                        <td style="text-align:center">
                            <asp:Label ID="lbMa" runat="server" Text='<%# Eval("DommandTransferOrder_Alias") %>'></asp:Label>
                            <asp:Label ID="lbIdOrder" Visible="false" runat="server" Text='<%# Eval("DommandTransferOrder_ID") %>'></asp:Label>
                            <input type="hidden" id="hiddenId" value='<%# Eval("DommandTransferOrder_ID") %>' runat="server" name="hiddenId" />
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName" CommandName="Accept" runat="server"><%# Eval("DommandTransferOrder_Date","{0:dd/MM/yyyy}")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_A" CommandName="Accept" runat="server"><%# Eval("Vehicle_Number")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_B" CommandName="Accept" runat="server"><%# Eval("FullNameMem")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_C" CommandName="Accept" runat="server"><%# Eval("VehicleGroup_Name_Old")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_D" CommandName="Accept" runat="server"><%# Eval("Type_Vehicle_Name")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                             <asp:LinkButton ID="link_Length" CommandName="Accept" runat="server" Text='<%# Eval("Blick_Vehicle_Length")%>'></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                             <asp:LinkButton ID="link_Hight" CommandName="Accept" runat="server" Text='<%# Eval("Block_Vehicel_Hight")%>'></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                             <asp:LinkButton ID="link_Width" CommandName="Accept" runat="server" Text='<%# Eval("Block_Vehicel_Width")%>'></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <asp:PlaceHolder runat="server" ID="lstViewAll"></asp:PlaceHolder>
                </LayoutTemplate>
             </asp:ListView>
        </tbody>
    </table>
    <!--------------Kêt-thúc----------------->
    </div>

    <!-------------Phân-trang---------------->
    <table  class="bordered">
        <thead>
            <tr>
                <th class="pager">
                    <asp:DataPager ID="DataPagerListAll" runat="server" 
                        OnPreRender="DataPagerListAll_PreRender" PagedControlID="ListViewAll">
                        <Fields>
                            <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;" 
                                ShowFirstPageButton="True" ShowNextPageButton="False" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;" 
                                ShowLastPageButton="True" ShowPreviousPageButton="False" />
                        </Fields>
                    </asp:DataPager>
                </th>
            </tr>
        </thead>
    </table>
    <!--------------Kêt-thúc----------------->
    <div class="clr"></div>
    </div>

    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title">Thông phiếu xuất</h3>
        </div>

        <div class="panel-body">
            <div class="div-search-texbox">
                <asp:TextBox ID="txtSearch" placeholder="Nhập vào từ khoá tìm kiếm..." CssClass="textbox_child_Search" runat="server"></asp:TextBox>      
            </div>

            <div class="div-search">
                <asp:Button ID="cmdSerach" runat="server" CssClass="btn-add-search" Text="" OnClick="cmdSerach_Click" />
                <asp:Button ID="cmdRefesh" runat="server" CssClass="btn-add-refesh"  Text="" onclick="cmdRefesh_Click" />
            </div>

            <div class="table-responsive">
                <!-----------Hiễn-Thị-Dữ-Liệu------------>
                <table  class="bordered">
                    <thead>
                        <tr>
                            <th width="5%">STT</th>        
                            <th width="5%">
                                #
                            </th>
                            <th width="10%">Mã phiếu CT</th>
                            <th width="10%">Mã hàng hoá</th>
                            <th width="10%">Số lượng</th>
                            <th width="10%">Số xuất</th>
                            <th width="5%">Trọng lượng</th>
                            <th width="5%">ĐVT</th>
                            <th width="5%">Tổng tiền</th>
                            <th width="10%">Ngày tạo</th>
                            <th width="10%">Ghi chú</th>
                        </tr>
                    </thead>

                    <tbody>
                         <asp:ListView ID="ListViewDoLine" runat="server" ItemPlaceholderID="lstViewoLine" DataKeyNames="RowID" OnItemCommand="ListViewDoLine_ItemCommand" OnItemDataBound="ListViewDoLine_ItemDataBound">
                            <ItemTemplate>
                                <tr runat="server" id="SetColor">
                                    <td align="center" style="text-align:center">
                                        <asp:Label ID="lb_lst_ID" runat="server" Text='<%# Eval("RowID") %>'></asp:Label>
                                    </td>

                                    <td style="text-align:center">
                                        <asp:CheckBox ID="chkListDoLine"  runat="server" />
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="linkListName_A" CommandName="Accept" runat="server"><%# Eval("No_")%></asp:LinkButton>
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="linkListName_B" CommandName="Accept" runat="server"><%# Eval("ItemNo")%></asp:LinkButton>
                                        <input type="hidden" id="hiddenId" value='<%# Eval("RowID") %>' runat="server" name="hiddenId" />
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="link_Amount" CommandName="Accept" runat="server" Text='<%# Eval("Amount")%>'></asp:LinkButton>
                                    </td>

                                    <td style="text-align:right">
                                        <asp:TextBox ID="txtSoLuongXuat" onkeypress="return ValidateKeypress(/\d/,event);" placeholder="Nhập vào số lượng xuất" CssClass="textbox_child_output" runat="server" Text="0"></asp:TextBox>
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="linkListName" CommandName="Accept" runat="server" Text ='<%# Eval("NetWeight","{0:0,00}")%>'></asp:LinkButton>
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="LinkButton3" CommandName="Accept" runat="server"><%# Eval("Unit")%></asp:LinkButton>
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="linkListName_C" CommandName="Accept" runat="server"><%# Eval("Total","{0:0.00}")%></asp:LinkButton>
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="LinkButton2" CommandName="Accept" runat="server"><%# Eval("PostingDate","{0:dd/MM/yyyy}")%></asp:LinkButton>
                                    </td>

                                    <td style="text-align:center">
                                        <asp:LinkButton ID="linkListName_F" CommandName="Accept" runat="server"><%# Eval("Description")%></asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <asp:PlaceHolder runat="server" ID="lstViewoLine"></asp:PlaceHolder>
                            </LayoutTemplate>
                         </asp:ListView>
                    </tbody>
                </table>
                <!--------------Kêt-thúc----------------->

                <!-------------Phân-trang---------------->
                <table  class="bordered">
                    <thead>
                        <tr>
                            <th class="pager">
                                <asp:DataPager ID="DataPagerListViewDoLine" runat="server" 
                                    OnPreRender="DataPagerListViewDoLine_PreRender" PagedControlID="ListViewDoLine">
                                    <Fields>
                                        <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;" 
                                            ShowFirstPageButton="True" ShowNextPageButton="False" />
                                        <asp:NumericPagerField />
                                        <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;" 
                                            ShowLastPageButton="True" ShowPreviousPageButton="False" />
                                    </Fields>
                                </asp:DataPager>
                            </th>
                        </tr>
                    </thead>
                </table>
                <!--------------Kêt-thúc----------------->
            </div>
        </div>
    </div>
</ContentTemplate>
</asp:UpdatePanel>

<!-------------Thông-Bao----------------->
<div id="thongbao" title="Thông Báo">
    <asp:UpdatePanel ID="updatePanelThongBao" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <p>
                <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
                <asp:Label ID="lbIdOrderId" CssClass="error-msg" runat="server" Text=""></asp:Label>
                <asp:Label ID="lbIdDoNew" CssClass="error-msg" runat="server" Text=""></asp:Label>

                <asp:Label ID="lbKQ_A" CssClass="error-msg" runat="server" Text=""></asp:Label>
                <asp:Label ID="lbKQ_B" CssClass="error-msg" runat="server" Text=""></asp:Label>
                <asp:Label ID="lbThongBaoLoi" CssClass="error-msg" runat="server" Text=""></asp:Label>
            </p>
            <hr />
            <div class="toolbar-ui-footer">
                <asp:Button ID="btnSave" CssClass="btn btn-info" Height="29px" runat="server" 
                    Text="Lưu lại" onclick="btnSave_Click" />

                <asp:Button ID="cmdCloseThongBao" CssClass="btn btn-info" Height="29px" runat="server" 
                    Text="Đóng lại" onclick="cmdCloseThongBao_Click" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
<!--------------Kêt-thúc----------------->
</asp:Content>